<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
  <script>
    document.createElement = (function() {
      const fn = document.createElement.bind(document);
      return function(type) {
        const result = fn(type);
        if(type === 'script') {
          result.crossOrigin = 'anonymous';
        }
        return result;
      }
    })();
    window.onerror = function (msg, url, row, col, error) {
      console.log('我知道错误了，也知道错误信息');
      console.log({
        msg,  url,  row, col, error
      })
      return true;
    };
    $.ajax({
      url: 'http://localhost:8081/data',
      dataType: 'jsonp',
      success: (data) => {
        console.log(data);
      }
    })
  </script>
</body>
</html>